/**
 * 张强 on 20170729
 *
 */
import React, { Component } from 'react'
import style from './list.scss'
import { Toast } from 'antd-mobile'

export default class OrderListMsg extends Component {
	constructor(props) {
		super(props);
		this.state = {
		}
	}

	toUrl(url){
		this.context.router.push(url);
	}

	render() {
		let res = this.props.orderList;
		return (
			<div className={style.orderList} onClick={()=>{this.toUrl(`orderDetails/${res.orderId}/${res.chargeOrderId}/orderList`)}}>
				<div style={{alignItems: 'center', justifyContent: 'center', height: 'auto', backgroundColor: '#fff' }}>
					<div className={style.list+' '+'border_bottom_1'}>
						<img className={style.region} src="./images/region_icon.png" alt=""/>
						<div className={style.orderType+' '+'cf'}>
							<span className="text-overflow-1">{res.orderTitle}</span>
							<span>￥{res.orderAmount/100}</span>
						</div>
						<div className={style.orderNum}>
							<span>订单号：{res.orderId}</span>
							<span style={res.status==3||res.status==4||res.status==5?{color: 'red'}:{}}>{res.statusName}</span>
						</div>
					</div>
				</div>
			</div>
		)
	}
}

OrderListMsg.contextTypes = {
	router: React.PropTypes.object.isRequired
};

OrderListMsg.defaultProps = {

};

